<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const reg = /^(\-|\+)?\d+(\.\d+)?$/
    console.log(reg.test(12));
    console.log(reg.test(-9));
    console.log(reg.test(10.64));
    console.log(reg.test(-12.95));
    console.log(reg.test("hhh"));
    
  </script>
</body>
</html>